{include file="header.tpl"}
		<div id="page">
			<div id="header">
				<a href="#menu"></a>
				{$row.title} - CountSheep
			</div>
			<div id="content">
			   <div id="articlebox">
			        <p><a href="#" id="goback" style="text-decoration:none;font-weight:bold;color:#1d953f;font-size:12px;"><< 返回</a></p>
					<p><img src="{$row.image}" width="330px" height="200px" /></p>
			        <h1>{$row.title}</h1>	
			        <div id="article">{$row.content}</div>
					
                    {if $row.cid == '7'}
                    {else}			        
					<p style="float:right">{$row.addDate}</p>
                    {/if}


                    {if $row.cid == '7'}
                    {else}
					<div id="addComment">
		           	   <p class="cTitle">评论</p>
					   <div class="cContent">
                       <form id="cForm">
                            <textarea style="resize:none;width:80%;float:left" rows=3 name="details" id="details"></textarea>
							<input type="hidden" name="aid" id="aid" value="{$row.id}" />
					        <input type="submit" name="submit" value="提交" style="border:0;height:45px;line-height:45px;margin:5px 0 0 10px;background:#1d953f;color:#fff;" />
					   </form>
					   </div>
			        </div>
                    {/if}
                    
					<div id="comment">
					    {section name=s loop=$per}
					     <div class="box">
                              <p>游客: {$per[s].details}&nbsp;&nbsp;&nbsp;&nbsp;({$per[s].d_time})</p>
							  {if $per[s].reply == ""}
							  <p>博主还未回复</p>
							  {else}
						      <p>G.J: {$per[s].reply}&nbsp;&nbsp;&nbsp;&nbsp;({$per[s].r_time})</p>
							  {/if}
						 </div>
						 {/section}
					</div>
                </div>				
			</div>
			<nav id="menu">
				<ul>
					<li><a href="index.php">首页</a></li>
					<li><a href="web.php?cid=1">HTML / HTML5</a></li>
					<li><a href="web.php?cid=2">CSS （层叠样式表）</a></li>
					<li><a href="web.php?cid=3">JavaScript / jQuery</a></li>
					<li><a href="web.php?cid=4">随笔</a></li>
					<li><a href="web.php?cid=5">转载</a></li>
					<li><a href="web.php?cid=6">笑话集</a></li>
					<li><a href="message.php">留言板</a></li>
					<li><a href="about.php">关于博主</a></li>
				</ul>
			</nav>
		</div>
<script type="text/javascript">
			$(function() {
				$('nav#menu').mmenu();

				$('#goback').bind('click',function(){
				        window.location.href = 'index.php';
				});
				$('input[type=submit]').bind('click',function(){
					    if($('#details').val().replace(/(^\s*)|(\s*$)/g,'').length < 5){
						      alert('评论不得少于5个字符');
						}else{
						      $('#cForm').attr('method','post');
						      $.post('./comment.php',$('#cForm').serialize(),function(data){
							        if(data){
										   alert('评论成功！');
									       window.location.reload();
									}else{
									       alert('评论失败！');
									}
							  });
						}
						return false;
					});
			});
</script>
{include file="footer.tpl"}
